Skip to content

Discovery and header additions for the experiment description (Stage 1, PR 6) - #190

Merged
guijacquemet merged 4 commits into
mainfrom
claude/discovery-header-additions
Nov 7, 2026
Merged

guijacquemet merged 4 commits into
mainfrom
claude/discovery-header-additions

Conversation

@guijacquemet

Copy link
Copy Markdown
Contributor

Summary

Stage 1 design PR 6 (design §1 card 2, §3 modules, §5 row 6). Additive and behaviour-preserving; nothing in the notebook or CLI uses it yet.

  • NFC and mask-type names (only with a description, owner decision Q1). preflight(..., with_description=True) (also remasked, find_masks) refuses:
    • a condition, repeat or technical-repeat folder that is not Unicode NFC: R_FOLDER_NOT_NFC;
    • a discovered mask type that breaks the Label rules (NA, cells): R_MASK_TYPE_NAME_INVALID;
    • a mask type that is not NFC: R_FOLDER_NOT_NFC.
      Nothing is renamed or normalized. Without a description (the default) these names are accepted exactly as in v0.4. New module name_issues.
  • Raw header channel names. TiffMetadata.raw_channel_names and FileEntry.raw_channel_names hold the names as read, untrimmed. channel_names stays trimmed, same_source ignores the new field, and the manifest file entry gains the optional key raw_channel_names, written only when the header names a channel. The OME header reading moved from metadata.py to ome_header.py (the file-length baseline allows no growth).
  • Phase-aware progress. preflight(progress=cb) calls cb(phase, done, total, path) for the phases folders, headers (once per image), masks and acquisitions. run.phases.progress_text words them ("2/4 headers 120/480"). Progress changes nothing about the result (tested with and without bind_headers).

Decisions and deviations

  • Q1 and Q7 as given. Time-lapses need no change here.
  • The design lists the NFC check under discovery.py. I put the folder check in name_issues and apply it in preflight, because discovery.py is at its code-rules size baseline (609 lines) and may not grow. discover_experiment is unchanged; call name_issues.non_nfc_folders_issue(discovery.leaves) to run the check on a bare discovery.
  • Not done (later PRs): the R_HEADER_CONTRADICTION comparison of P26 (PR 8), and notebook or CLI display of the progress. No wording for the new codes in the user guide yet, since no run uses them.
  • Baseline tools/code_rules_baseline.json: metadata.py lines lowered 721 to 700 by --update-baseline. New modules got layers in pyproject.toml.

Part of the Stage 1 plan (PR 6 of 17; no issue number).

Tests

  • New: tests/test_spec_discovery.py (conformance P21, the recorded part of P26, P29; run under the skip-is-failure gate) and tests/test_preflight_progress.py.
  • On the old src, 21 of the 24 new tests fail (for example test_p21_a_decomposed_folder_is_refused_with_a_description, test_p29_na_and_a_leading_space_are_invalid_mask_type_names, test_the_headers_phase_counts_every_image_with_its_path, test_raw_names_round_trip_through_the_manifest). The 3 that pass are the "without a description behaves as v0.4" tests, as intended.
  • python tools/check.py: ruff check and format clean, code rules clean, 3570 passed, 4 skipped. The skips are environment-only and also skip on main: case-insensitive file system checks (3) and a root-permissions test (1). The legacy suite (3546 tests) is unchanged and passes.

Notes for review


Generated by Claude Code

…1, PR 6)

With a description in use, preflight refuses folder labels and mask type names that
are not Unicode NFC (R_FOLDER_NOT_NFC) and mask type names that break the Label rules
(R_MASK_TYPE_NAME_INVALID); runs without a description are unchanged (owner decision Q1).
Records the raw header channel names per image (TiffMetadata and the manifest file
entry, optional key) and reports phase-aware progress from preflight.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm

# Conflicts:
#	CHANGELOG.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm

# Conflicts:
#	CHANGELOG.md
Docstring wording only; no behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm
@guijacquemet
guijacquemet merged commit 0f025c6 into main Nov 7, 2026
7 checks passed
@guijacquemet
guijacquemet deleted the claude/discovery-header-additions branch November 7, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants